package com.xxxx.web.dto;

import com.xxxx.web.entity.*;
import com.xxxx.web.enums.*;
import com.xxxx.web.tools.dto.BaseDto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 库位表类
 */
@Data
public class WarehouseBinDto extends BaseDto {


    /**
     * 层
     */
    @JsonProperty("Level")
    private String Level;


    /**
     * 所属仓库
     */
    @JsonProperty("WarehouseId")
    private Integer WarehouseId;


    /**
     * 类型
     */
    @JsonProperty("Type")
    private String Type;


    /**
     * 库位编码
     */
    @JsonProperty("BinCode")
    private String BinCode;

    @JsonProperty("WarehouseDto")
    private WarehouseDto WarehouseDto;

    /**
     * 把库位表传输模型转换成库位表实体
     */
    public WarehouseBin MapToEntity() throws InvocationTargetException, IllegalAccessException {
        WarehouseBin WarehouseBin = new WarehouseBin();

        BeanUtils.copyProperties(WarehouseBin, this);

        return WarehouseBin;
    }

}
